1 <?php
2 session_start();
// Use session variable on this page. This function must put on the top of page.
3 if
(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable "username" does not exist.
4 header(
"location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
5 }

6 else

7 {
8     include_once
"db.php";
9
10 ?><!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
11 "http:
//www.w3.org/TR/html4/loose.dtd">
12 <html>
13 <head>
14 <title>Welcome to Stock Management System !</title>
15 <meta http-equiv=
"Content-Type" content="text/html; charset=iso-8859-1">
16 <link rel=
"stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
17         <link rel=
"stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
18         <script src=
"js/jquery.min.js" type="text/javascript"></script>
19         
20         
21
22         <script src=
"js/jquery.validationEngine-en.js" type="text/javascript"></script>
23         <script src=
"js/jquery.validationEngine.js" type="text/javascript"></script>
24          <script src=
"js/jquery.hotkeys-0.7.9.js"></script>
25         <!-- AJAX SUCCESS TEST FONCTION
26             <script>function callSuccessFunction(){alert(
"success executed")}
27                     function callFailFunction(){alert(
"fail executed")}
28             </script>
29         -->
30         
31         <script>
32         
33         
34         
35         
36         
37         $(document).ready(function() {
38             
// SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() },
39              $(
"#uom").focus();
40             $(
"#form1").validationEngine(),
41             
42             jQuery(document).bind(
'keydown', 'Ctrl+s',function() {
43           $(
'#form1').submit();
44           
return false;
45             });
46             
47             jQuery(document).bind(
'keydown', 'Ctrl+r',function() {
48           $(
'#form1').reset();
49           
return false;
50             });
51             jQuery(document).bind(
'keydown', 'Ctrl+a',function() {
52             window.location =
"add_UOM.php";
53           
return false;
54             });
55             jQuery(document).bind(
'keydown', 'Ctrl+0',function() {
56             window.location =
"admin.php";
57           
return false;
58             });
59             jQuery(document).bind(
'keydown', 'Ctrl+1',function() {
60             window.location =
"add_purchase.php";
61               
return false;
62             });
63             jQuery(document).bind(
'keydown', 'Ctrl+2',function() {
64             window.location =
"add_stock_sales.php";
65               
return false;
66             });
67             jQuery(document).bind(
'keydown', 'Ctrl+3',function() {
68             window.location =
"add_stock_details.php";
69               
return false;
70             });
71             jQuery(document).bind(
'keydown', 'Ctrl+4',function() {
72             window.location =
"add_category.php";
73               
return false;
74             });
75             jQuery(document).bind(
'keydown', 'Ctrl+5',function() {
76             window.location =
"add_supplier_details.php";
77               
return false;
78             });
79             jQuery(document).bind(
'keydown', 'Ctrl+6',function() {
80             window.location =
"add_customer_details.php";
81               
return false;
82             });
83             jQuery(document).bind(
'keydown', 'Ctrl+7',function() {
84             window.location =
"view_stock_entries.php";
85               
return false;
86             });
87             jQuery(document).bind(
'keydown', 'Ctrl+8',function() {
88             window.location =
"view_stock_sales.php";
89               
return false;
90             });
91             jQuery(document).bind(
'keydown', 'Ctrl+9',function() {
92             window.location =
"view_stock_details.php";
93               
return false;
94             });
95             
//$.validationEngine.loadValidation("#date")
96             
//alert($("#formID").validationEngine({returnIsValid:true}))
97             
//$.validationEngine.buildPrompt("#date","This is an example","error") // Exterior prompt build example // input prompt close example
98             
//$.validationEngine.closePrompt(".formError",true) // CLOSE ALL OPEN PROMPTS
99         });
100     </script>
101 <style type=
"text/css">
102 <!--
103 body {
104     margin-left: 0px;
105     margin-top: 0px;
106     margin-right: 0px;
107     margin-bottom: 0px;
108     background-color: #FFFFFF;
109 }
110
111 *{
112 padding: 0px;
113 margin: 0px;
114 }
115 #vertmenu {
116 font-family: Verdana, Arial, Helvetica, sans-serif;
117 font-size:
100%;
118 width: 160px;
119 padding: 0px;
120 margin: 0px;
121 }
122
123 #vertmenu h1 {
124 display: block;
125 background-color:#FF9900;
126 font-size:
90%;
127 padding: 3px
0 5px 3px;
128 border: 1px solid #
000000;
129 color: #
333333;
130 margin: 0px;
131 width:159px;
132 }
133
134 #vertmenu ul {
135 list-style: none;
136 margin: 0px;
137 padding: 0px;
138 border: none;
139 }
140 #vertmenu ul li {
141 margin: 0px;
142 padding: 0px;
143 }
144 #vertmenu ul li a {
145 font-size:
80%;
146 display: block;
147 border-bottom: 1px dashed #C39C4E;
148 padding: 5px 0px 2px 4px;
149 text-decoration: none;
150 color: #
666666;
151 width:160px;
152 }
153
154 #vertmenu ul li a:hover, #vertmenu ul li a:focus {
155 color: #
000000;
156 background-color: #eeeeee;
157 }
158 .style1 {color: #
000000}
159
160 -->
161 </style>
162 </head>
163
164 <body>
165 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
166   <tr>
167     <td align=
"center" valign="top"><table width="960" border="0" cellspacing="0" cellpadding="0">
168       <tr>
169         <td><table width=
"960" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECECEC">
170           <tr>
171             <td height=
"90" align="left" valign="top"><img src="images/topbanner.jpg" width="960" height="82"></td>
172           </tr>
173           <tr>
174             <td height=
"800" align="left" valign="top"><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECECEC">
175               <tr>
176                 <td width=
"130" align="left" valign="top">
177                 
178                 <br>
179
180                 <strong>Welcome <font color=
"#3399FF"><?php echo $_SESSION['username']; ?> !</font></strong><br> <br>
181 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
182   <tr>
183     <td align=
"center"><a href="admin.php"><img src="images/home.png" width="130" height="99" border="0"></a></td>
184     </tr>
185   <tr>
186     <td align=
"center">&nbsp;</td>
187     </tr>
188   <tr>
189     <td align=
"center"><a href="add_purchase.php"><img src="images/purchase.png" width="130" height="124" border="0"></a></td>
190     </tr>
191   <tr>
192     <td align=
"center">&nbsp;</td>
193     </tr>
194   <tr>
195     <td align=
"center"><a href="add_stock_sales.php"><img src="images/sales.png" width="146" height="111" border="0"></a></td>
196     </tr>
197   <tr>
198     <td align=
"center">&nbsp;</td>
199     </tr>
200   <tr>
201     <td align=
"center"><a href="report.php"><img src="images/reports.png" width="131" height="142" border="0"></a></td>
202     </tr>
203   <tr>
204     <td align=
"center">&nbsp;</td>
205     </tr>
206   <tr>
207     <td align=
"center">&nbsp;</td>
208     </tr>
209   <tr>
210     <td align=
"center">&nbsp;</td>
211     </tr>
212 </table>
213
214
215     
216                 
217                 
218                 </td> <td height=
"500" align="center" valign="top">
219 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
220   <tr>
221     <td><a href=
"add_stock_details.php"><img src="images/addstockdetails.png" width="67" height="62" border="0"></a></td>
222     <td><a href=
"add_supplier_details.php"><img src="images/supplier.png" width="67" height="54" border="0"></a></td>
223     <td><a href=
"add_customer_details.php"><img src="images/customer.png" width="67" height="54" border="0"></a></td>
224     <td><a href=
"add_category.php"><img src="images/categories.png" width="67" height="54" border="0"></a></td>
225     <td><a href=
"view_stock_sales.php"><img src="images/vsales.png" width="67" height="54" border="0"></a></td>
226     <td><a href=
"view_stock_entries.php"><img src="images/vpurchase.png" width="67" height="54" border="0"></a></td>
227     <td><a href=
"view_stock_details.php"><img src="images/stockdetails.png" width="67" height="54" border="0"></a></td>
228     <td><a href=
"view_stock_availability.php"><img src="images/savail.png" width="67" height="54" border="0"></a></td>
229      <td align=
"left" valign="top"><a href="view_customer_details.php"><img src="images/customers.png" width="94" height="22" border="0"></a><br> <a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22" border="0"></a><br>
230       <a href=
"view_payments.php"><img src="images/payments.png" width="94" height="22" border="0"></a></td>
231     <td align=
"left" valign="top"><a href="view_stock_sales_payments.php"><img src="images/outstanding.png" width="94" height="22" border="0"></a><br> <a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94" height="22" border="0"></a><br>
232       <a href=
"logout.php"><img src="images/logout.png" width="94" height="22" border="0"></a></td>
233   </tr>
234 </table>
235 <?php
236                 
if(isset($_POST['uom']))
237
238             {
239             
240             $uom=mysql_real_escape_string($_POST[
'uom']);
241             $uomspec=mysql_real_escape_string($_POST[
'uomspec']);
242             
243             $count = $db->countOf(
"uom_details", "name='$uom'");
244         
if($count==1)
245             {
246         echo
"<font color=red> Dublicat Entry. Please Verify</font>";
247             }
248             
else
249             {
250                 
251             
if($db->query("insert into uom_details(name,spec) values('$uom','$uomspec')"))
252             echo
"<br><font color=green size=+1 >[ $uom ] UOM Added !</font>" ;
253             
else
254             echo
"<br><font color=red size=+1 >Problem in Adding !</font>" ;
255             
256             }
257             
258             
259             }
260                 
261                 ?>
262                 
263                 <br>
264 <br>
265
266                 
267                 <form name=
"form1" method="post" id="form1" action="">
268                   
269                   <p align=
"center"><strong>Add New Category </strong> </p>
270                   <table width=
"400" border="0" cellspacing="0" cellpadding="0">
271                     <tr>
272                       <td width=
"150">&nbsp;</td>
273                       <td width=
"150">&nbsp;</td>
274                       <td width=
"150">&nbsp;</td>
275                     </tr>
276                     <tr>
277                       <td width=
"150">&nbsp;</td>
278                       <td width=
"150">&nbsp;</td>
279                       <td width=
"150">&nbsp;</td>
280                     </tr>
281                     <tr>
282                       <td width=
"150">UOM Name </td>
283                       <td width=
"150"><input name="uom" type="text" id="uom" class="validate[required,length[0,100]] text-input" ></td>
284                       <td width=
"150">&nbsp;</td>
285                     </tr>
286                     <tr>
287                       <td width=
"150">&nbsp;</td>
288                       <td width=
"150">&nbsp;</td>
289                       <td width=
"150">&nbsp;</td>
290                     </tr>
291                     <tr>
292                       <td>UOM Specification</td>
293                       <td><input name=
"uomspec" type="text" id="uomspec" ></td>
294                       <td>&nbsp;</td>
295                     </tr>
296                     <tr>
297                       <td>&nbsp;</td>
298                       <td>&nbsp;</td>
299                       <td>&nbsp;</td>
300                     </tr>
301                     <tr>
302                       <td>&nbsp;</td>
303                       <td><input type=
"submit" name="Submit" value="Add"></td>
304                       <td>&nbsp;</td>
305                     </tr>
306                   </table>
307                 </form></td>
308               </tr>
309             </table>
310             
311         </td>
312           </tr>
313           <tr>
314             <td height=
"30" align="center" bgcolor="#72C9F4"><span class="style1"><a href="http://www.pluskb.com">Developed by PlusKB Innovations</a></span></td>
315           </tr>
316         </table></td>
317       </tr>
318     </table></td>
319   </tr>
320 </table>
321
322 </body>
323 </html>
324 <?php
325 }
326 ?>


Gõ tìm kiếm nhanh...